package com.woniu40.petai_user.mapper;

import com.woniu40.petai_user.entity.Dynamic;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.woniu40.petai_user.vo.DynamicVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DynamicMapper {
    int deleteByPrimaryKey(Integer dynamicId);

    int insert(Dynamic record);

    Dynamic selectByPrimaryKey(Integer dynamicId);

    List<Dynamic> selectAll(Integer uid);

    int updateByPrimaryKey(Dynamic record);

    List<DynamicVo> selectByTips(@Param("plateId") Integer plateId, @Param("like") String like,
                                 @Param("order") Integer order);

    List<Integer> findAttentionUserId(Integer userId);

    @Update("update t_dynamic set view_number = view_number+1 where dynamic_id =#{dynamicId}")
    int updataViewNum(Integer dynamicId);

    List<Dynamic> selectDynamicByUserId(Integer userId);

    List<DynamicVo> selectByTips2(@Param("like") String like, @Param("order") Integer order);
}